/*  iImager (network disk imaging via iscsi)
	Copyright (C) 2009-2010 Yao Wei <njustyw@gmail.com>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

#include "qtsingleapplication.h"
#include "Q_Imager.h"

int main(int argc, char *argv[])
{
	QtSingleApplication app(argc, argv);
	QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath());
	
	QTextCodec::setCodecForTr(QTextCodec::codecForName("utf-8"));
	QTextCodec::setCodecForCStrings(QTextCodec::codecForName("utf-8"));
	
	QTranslator translator, translator2;
	translator.load("iImager_zh_CN", QCoreApplication::applicationDirPath()
#ifdef Q_WS_X11
		+"/../share/trimps"
#endif
							);
	translator2.load("qt_zh_CN", QCoreApplication::applicationDirPath()
#ifdef Q_WS_X11
		+"/../share/trimps"
#endif
							);
	app.installTranslator(&translator);
	app.installTranslator(&translator2);

	if(app.isRunning()) 
		return 0; 

	//HttpClient* client = new HttpClient;

#if 0
	HDImagingCLI cli;
	cli.processCommand();
#else
	HDImagingService service;
#endif

 	return app.exec();
}
